<template>
    <a-carousel class="com-banner" v-if="list.length" arrows>
      <div
        slot="prevArrow"
        slot-scope="props"
        class="custom-slick-arrow"
        style="left: 10px;zIndex: 1">
        <a-icon type="left-circle"/>
      </div>
      <div slot="nextArrow" slot-scope="props" class="custom-slick-arrow" style="right: 10px">
        <a-icon type="right-circle"/>
      </div>
      <div class="box-cover-item" @click="$router.push({path: '/desc-va', query: {url: item.url, title: item.title}})" v-for="item in list" :key="item.img">
        <img style="width: 100%;height: 100%;object-fit: cover" :src="item.img" :alt="item.title">
        <h3>{{ item.title }}</h3>
      </div>
    </a-carousel>
</template>

<script>
export default {
  name: "com-banner",
  props: {
    list: {
      type: Array,
      default: function () {
        return []
      }
    }
  }
}
</script>

<style scoped lang="scss">
/* For demo */
.com-banner {
  @include wh(100%, 550px);
  overflow: hidden;
}
.ant-carousel {
  /deep/ .slick-slide {
    @include wh(100%, 550px);
    text-align: center;
    background: #364d79;
    overflow: hidden;
    >div {
       @include wh;
    }
  }
  /deep/ .custom-slick-arrow {
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    font-size: 25px;
    color: #fff;
    //background-color: rgba(31, 45, 61, 0.11);
    opacity: 0.3;
    &:before {
      display: none;
    }
    &:hover {
      opacity: 0.5;
    }
  }


  /deep/ .box-cover-item {
    position: relative;
    @include wh;
    img {
      @include wh;
      object-fit: contain;
    }
    h3 {
      @include wh(100%, auto);
      @extend %ellipsis;
      font-size: 16px;
      position: absolute;
      bottom: 0;
      left: 0;
      padding: 20px;
      line-height: 40px;
      margin: 0;
      background-color: rgba(31, 45, 61, 0.3);
      color: $white;
    }
  }

}

</style>
